package com.telit.firecommand.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.telit.firecommand.entity.CameraPresetInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * CameraPresetInfoDao（暂未启用）
 *
 * @author yuezhuang
 * @date 2022-08-31
 */
@Repository
public interface CameraPresetInfoDao extends BaseMapper<CameraPresetInfo> {

    int deleteByPrimaryKey(Long id);

    int insert(CameraPresetInfo record);

    int insertSelective(CameraPresetInfo record);

    CameraPresetInfo selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CameraPresetInfo record);

    int updateByPrimaryKey(CameraPresetInfo record);

    /**
     * 通过监控id删除预置点数据
     *
     * @param cameraId
     * @param presetIndex
     */
    void deleteByCameraId(@Param("cameraId") Long cameraId, @Param("presetIndex") Integer presetIndex);

    /**
     * 查询停留时间
     *
     * @param cameraId
     * @param presetPointName
     *
     * @return
     */
    String querySpeedTime(@Param("cameraId") Long cameraId, @Param("presetPointName") String presetPointName);

    /**
     * 查询预置点
     *
     * @param cameraId
     *
     * @return
     */
    List<CameraPresetInfo> queryByCameraId(@Param("cameraId") Long cameraId);

    /**
     * 根据id和name查询预置点
     *
     * @param cameraId
     * @param presetName
     *
     * @return
     */
    CameraPresetInfo queryByCameraIdAndName(@Param("cameraId") Long cameraId, @Param("presetName") String presetName);

}